package cc.admin.common.db.table.entity;

import cn.hutool.core.util.StrUtil;
import lombok.Data;
/**
 * @author: ZhangHouYing
 * @date: 2022-01-20 10:02
 */
@Data
public class DataReader {

	public static DataReader of(String tableName, String cnd, String orderBy, Integer pageNo, Integer pageSize) {
		DataReader dataReader = new DataReader();
		dataReader.setTableName(tableName);
		dataReader.setCnd(cnd);
		if (StrUtil.isNotEmpty(orderBy)) {
			dataReader.setOrderBy(orderBy);
		}
		dataReader.setPageNo(pageNo);
		dataReader.setPageSize(pageSize);
		return dataReader;
	}

	public static DataReader of(String tableName, String cnd, Integer pageNo, Integer pageSize) {
		return of(tableName, cnd, null, pageNo, pageSize);
	}

	String tableName;
	String cnd;
	String orderBy;
	Integer pageNo;
	Integer pageSize;
}
